package com.morizhang.merchanmanager.api.service;

import com.alibaba.fastjson.JSONObject;
import com.morizhang.merchanmanager.api.ApiResult;
import com.morizhang.merchanmanager.api.IService;
import com.morizhang.merchanmanager.api.dao.UserDao;
import com.morizhang.merchanmanager.api.model.UserModel;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@ServiceAnnotation(name = "QueryAllUser")
public class QueryAllUser implements IService {
    @Autowired
    UserDao userDao;

    @Override
    public ApiResult callService(JSONObject requestParams) throws Exception {
        List<UserModel> allUser = userDao.selectAllUser();
        ApiResult result = new ApiResult();
        result.setSuccess(true);
        result.setData(allUser);
        return result;
    }
}
